#!/usr/bin/env python

class GIMPLE:
    def __init__(self, raw):
        self.id = raw[0]
        self.type = raw[1]
        if(raw[2] == 'NULL'):
            self.op0 = None
        else:
            self.op0 = raw[2]
        if(raw[3] == 'NULL'):
            self.op1 = None
        else:
            self.op1 = raw[3]
        if(raw[4] == 'NULL'):
            self.op2 = None
        else:
            self.op2 = raw[4]
        self.bb = raw[5]
        if(raw[6] == '(null)'):
            self.action = None
        else:
            self.action = raw[6]

    def debug(self):
        print "ID = ",
        print self.id,
        print "\t type = ",
        print self.type,
        print "\t op0 = ",
        print self.op0,
        print "\t op1 = ",
        print self.op1,
        print "\t op2 = ",
        print self.op2,
        print "\t action = ",
        print self.action
        print "\t block = ",
        print self.bb
